package org.sunsys.util;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.Properties;

public class PropertiesUtil {

	public static Properties getProperties(String propertiesFile) throws PropertiesFIleLoadingException {
		
		Properties properties = new Properties();
		Reader reader = null;
		try {
			 reader = new FileReader( new File(propertiesFile));
			properties.load( reader);
		}catch(IOException e1) {
			throw new PropertiesFIleLoadingException("Exception while loading properties file:"+propertiesFile, e1);
		}finally {
			if(reader!=null) {
				try {
					reader.close();
				}catch(IOException e2){
				}
			}
		}
		return properties;
	}
}
